
package org.igeek.atomqq.widget;

import org.igeek.atomqq.domain.Friend;
import org.igeek.atomqq.util.Utils;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;


/** 
 * 模仿QuickContactBadge
 * @author <a href="http://hangxin1940.cnblogs.com">hangxin1940@gmail.com</a>
 * @time 2012-2-6 下午03:43:55 
 */
public class FriendFaceBadgeView extends RelativeLayout implements OnClickListener {
	
	private Context context;
	private Friend friend;

    public FriendFaceBadgeView(Context context) {
        this(context, null);
        this.context=context;
        setOnClickListener(this);
    }

    public FriendFaceBadgeView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
        this.context=context;
        setOnClickListener(this);
    }

    public FriendFaceBadgeView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.context=context;
        setOnClickListener(this);
    }


	@Override
	public void onClick(View v) {
		try {
			FriendBadgeView fv=new FriendBadgeView(context,friend);
			Utils.showViewOnTopWindow(this,fv.getCustomHeight(),fv,context);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public void setFriend(Friend friend){
		this.friend=friend;
	}
	
	


	


}
